/*
 * @Author: jiu yin
 * @Date: 2024-06-28 15:57:35
 * @LastEditTime: 2024-06-28 16:46:15
 * @LastEditors: jiu yin zhen jing
 * @FilePath: \studio-web-admin\src\comment\Online_Modal_error\index.tsx
 * jiu
 */
import React, { useEffect } from "react";
import { devices_list } from "@/api/home";
import { Modal } from "antd";

export default function index(props: any) {

   
	const { callback } = props;
   

		devices_list({ status: 2 }).then((res: any) => {
			if (res.data.data.length) {
				Modal.error({
					title: "提示",
					content: (
						<div className="text-align-center">
							<p>有设备正在使用中</p>
							<p>更新可能影响使用,确定要继续吗?</p>
							<ul>
								{res.data.data.map((item: any, index: number) => (
									<li key={index}>设备SN： {item?.device_real_sn}</li>
								))}
							</ul>
						</div>
					),
					onOk: () => {
						console.log("OK");
						callback();
					},
				});
			} else {
				callback();
			}
		});


	return <div></div>;
}
